package com.donde.coche;

import com.donde.coche.R;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class Coche extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_coche);
        
        final Button b1 = (Button) findViewById(R.id.BotonNP);
        b1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Intent i = new Intent(Coche.this, VerPosicion.class);
				startActivity(i);
			}
		});
        
        final Button b2 = (Button) findViewById(com.donde.coche.R.id.BotonVP);
        b2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Toast.makeText(Coche.this, "Obteniendo posición", Toast.LENGTH_SHORT).show();
				Compartir c= Compartir.ObtenerUltimaPos();
				Toast.makeText(Coche.this,c.toString() , Toast.LENGTH_SHORT).show();
			}
		});
        
        final Button b3 = (Button) findViewById(R.id.BotonTR);
        b3.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Toast.makeText(Coche.this, "Trazando Ruta...", Toast.LENGTH_SHORT).show();
			}
		});
        
        final Button b4 = (Button) findViewById(R.id.BotonC);
        b4.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Toast.makeText(Coche.this, "Compartiendo ;D", Toast.LENGTH_SHORT).show();
			}
		});
        
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_coche, menu);
        return true;
    }
}
